;
const random = {
    VERSION: '0.0.1',
    TIME: '2017-07-25'
};

random.double = function(min, max) {
    return Math.random() * (max - min) + min;
};

random.integer = function(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
};

random.string = function(len, caseSensitive = true, withNum = true, withSpec = true) {
    const lower = 'abcdefghijklmnopqrstuvwxyz';
    const upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
    const num = '0123456789';
    const spec = '$-_';
    const s = lower + (caseSensitive && upper || '') + (withNum && num || '') + (withSpec && spec || '');
    let str = '';
    for (let i = 0; i < len; i++) {
        str += s[random.integer(0, s.length - 1)];
    }
    return str;
};